package letcode1456

func MaxVowels(s string, k int) int {
	ans, tmp := 0, 0
	for right, value := range s {
		if value == 'a' || value == 'e' || value == 'i' || value == 'o' || value == 'u' {
			tmp++
		}

		if right < k-1 {
			continue
		}

		ans = max(ans, tmp)
		out := s[right-k+1]
		if out == 'a' || out == 'e' || out == 'i' || out == 'o' || out == 'u' {
			tmp--
		}
	}

	return ans
}
